<template>
  <view>
    <uni-list>
      <uni-list-item
        v-for="item in datalist"
        :key="item"
        :title="item.weixinNumber"
        showArrow
		:to="'/pages/blindboxlist/detial?id=' + item._id"
        :note="
          new Date(parseInt(item.date))
            .toLocaleString()
            .replace(/:\d{1,2}$/, ' ')
        "
        :thumb="item.imgList[0]"
        thumb-size="lg"
        rightText="详情"
      />
    </uni-list>
  </view>
</template>

<script setup>
import { ref } from "vue";
const datalist = ref([]);
const db = uniCloud.database();

const getDataList = async () => {
  uni.showLoading({
    title: "加载中...",
  });
  const res = await db
    .collection("blind_box_list")
    .where({ user_id: uni.getStorageSync("userInfo")._id })
    .get();
  datalist.value = res.result.data;
  uni.hideLoading();
};

getDataList();
</script>

<style>
</style>
